package com.onlinefurnitureshop.management.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.ServletResponseAware;
import org.apache.struts2.interceptor.SessionAware;

import com.opensymphony.xwork2.ActionSupport;
import com.sun.org.apache.xml.internal.resolver.helpers.PublicId;

public class BaseAction extends ActionSupport implements ServletRequestAware,ServletResponseAware,SessionAware{

	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	public HttpServletRequest request;
	public HttpServletResponse response;
	public Map<String,Object> sessionData;

	@Override
	public void setSession(Map sessionData) {
		// TODO Auto-generated method stub
		this.sessionData = sessionData;
	}

	@Override
	public void setServletResponse(HttpServletResponse response) {
		// TODO Auto-generated method stub
		this.response=response;
	}

	@Override
	public void setServletRequest(HttpServletRequest request) {
		// TODO Auto-generated method stub
		this.request=request;
	}
	
	public Subject subject(){
		return SecurityUtils.getSubject();
	}
	
}
